package com.kehutong.wxapi.response;

import org.coraframework.json.annotation.JSONField;

import java.util.List;

/**
 * 通讯录单个搜索响应对象
 * @author: liukunlong
 * @date: 2021-03-08 19:04
 */
public class ContactSearchResponse {

    /**
     * errcode
     */ /**
     * errcode : 0
     * errmsg : ok
     * is_last : false
     * query_result : {"user":{"userid":["zhangshan","lisi"],"open_userid":["wwxxxx","wwxxxa"]},"party":{"department_id":[1,2,3]}}
     */

    @JSONField(name = "errcode")
    private Integer errcode;
    /**
     * errmsg
     */
    @JSONField(name = "errmsg")
    private String errmsg;
    /**
     * isLast
     */
    @JSONField(name = "is_last")
    private Boolean isLast;
    /**
     * queryResult
     */
    @JSONField(name = "query_result")
    private QueryResultDTO queryResult;

    public Integer getErrcode() {
        return errcode;
    }

    public void setErrcode(Integer errcode) {
        this.errcode = errcode;
    }

    public String getErrmsg() {
        return errmsg;
    }

    public void setErrmsg(String errmsg) {
        this.errmsg = errmsg;
    }

    public Boolean getIsLast() {
        return isLast;
    }

    public void setIsLast(Boolean isLast) {
        this.isLast = isLast;
    }

    public QueryResultDTO getQueryResult() {
        return queryResult;
    }

    public void setQueryResult(QueryResultDTO queryResult) {
        this.queryResult = queryResult;
    }

    public static class QueryResultDTO {
        /**
         * user
         */ /**
         * user : {"userid":["zhangshan","lisi"],"open_userid":["wwxxxx","wwxxxa"]}
         * party : {"department_id":[1,2,3]}
         */

        @JSONField(name = "user")
        private UserDTO user;
        /**
         * party
         */
        @JSONField(name = "party")
        private PartyDTO party;

        public UserDTO getUser() {
            return user;
        }

        public void setUser(UserDTO user) {
            this.user = user;
        }

        public PartyDTO getParty() {
            return party;
        }

        public void setParty(PartyDTO party) {
            this.party = party;
        }

        public static class UserDTO {
            /**
             * userid
             */
            @JSONField(name = "userid")
            private List<String> userid;
            /**
             * openUserid
             */
            @JSONField(name = "open_userid")
            private List<String> openUserid;

            public List<String> getUserid() {
                return userid;
            }

            public void setUserid(List<String> userid) {
                this.userid = userid;
            }

            public List<String> getOpenUserid() {
                return openUserid;
            }

            public void setOpenUserid(List<String> openUserid) {
                this.openUserid = openUserid;
            }
        }

        public static class PartyDTO {
            /**
             * departmentId
             */
            @JSONField(name = "department_id")
            private List<Integer> departmentId;

            public List<Integer> getDepartmentId() {
                return departmentId;
            }

            public void setDepartmentId(List<Integer> departmentId) {
                this.departmentId = departmentId;
            }
        }
    }
}
